home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
doragard.swf
/
000714.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2013-04-24
|
2KB
|
67 lines
xpos = [5580,5435,5294,5150,4942,4816,4735,4606,4520,4383,4247,4103,3977,3770,3735,3606,3571,3445,3307,3213,3069,2932,2796,2659,2516,2323,2056,1889,1721,1560,1358,1222,1186,992,848,674,486,290,254,218,181,98,58,0];
var mouseListener = new Object();
var speed = 0;
var myx = 0;
var currentMouseOver;
var currentChar;
mouseListener.onMouseDown = function()
{
eval("_root.char" + currentChar)._y = 20000;
currentChar = currentMouseOver;
var i = currentMouseOver;
eval("_root.char" + i)._y = 256;
_root.marker2._yscale = 256 * 100;
_root.marker2._xscale = (xpos[i - 1] - xpos[i]) * 100;
_root.marker2._x = xpos[i] + myx;
};
mouseListener.onMouseMove = function()
{
if(_ymouse >= 256)
{
speed = 0;
}
else
{
speed = 256 >= Math.abs(_xmouse - 512) ? 0 : (512 - _xmouse) / 8;
}
};
setInterval(function()
{
if(_ymouse < 256)
{
var i;
var x = _xmouse - _root.textbar._x;
i = xpos.length - 1;
while(0 < i)
{
if(x < xpos[i - 1])
{
break;
}
i = eval("i") - 1;
}
currentMouseOver = i;
_root.marker._yscale = 256 * 100;
_root.marker._xscale = (xpos[i - 1] - xpos[i]) * 100;
_root.marker._x = xpos[i] + myx;
_root.textbar._x += 0.05;
}
if(0 >= myx + speed)
{
if(myx + speed < xpos[0] * -1 + 1024)
{
speed = 0;
}
}
else
{
speed = 0;
}
myx = eval("myx") + speed;
_root.textbar._x = myx;
_root.marker._x += speed;
_root.marker2._x += speed;
}
,20);
Mouse.addListener(mouseListener);